package com.tvunetworks.center.user.service;

import com.tvunetworks.center.common.model.dto.user.UserFeatureDTO;

import java.util.List;
/**
 * @author Etan Yang
 * @data: 2021/6/4 19:05
 * @program: tvucc-aggregator
 * @description:
 */
public interface UserRoleService {

    /**
     * 判断用户是否有权限
     * @param userId userId
     * @param feature feature
     * @return true:有权限 false:没有权限
     */
    boolean checkUserRole(String userId, String feature);

    /**
     * 列出用户所有feature，用于initLoginUser
     * @param userId userId
     * @return List
     */
    List<UserFeatureDTO> listUserRole(String userId);

    /**
     * UserFeature修改 同步到UserRole
     * @param userId userId
     * @param feature feature
     * @param enable enable
     */
    void updateUserRole(String userId, String feature, Integer enable);

    /**
     * UserFeature修改 同步到UserRole Admin移除feature的同时移除孩子的feature
     * @param userId userId
     * @param feature feature
     */
    void removeUserSonRole(String userId, String feature);
}
